n, m = map(int, input().split())
for i in range(0, n):
    for j in range(1, m):
        print(i * m + j, end=" ")
    print("PUM")
